package com.ssy.lingxi.member.merchant.api.constant;

import com.ssy.lingxi.common.language.LanguageHolder;

/**
 * 会员升级规则类型枚举
 */
public enum MemberLevelRuleTypeEnum {
    /**
     * 交易 - 1
     */
    BY_TRADE(1, "交易", "完成交易订单后，按照交易订单金额的百分比记入获取的升级分值"),

    /**
     * 登录 - 1
     */
    BY_LOGIN(2, "登录", "每次成功登录后，按照设置分值记入获取的升级分值"),

    /**
     * 评价 - 3
     */
    BY_COMMENT(3, "评价", "每次成功评价后，按照设置分值记入获取的升级分值");

    private Integer code;

    MemberLevelRuleTypeEnum(Integer code, String message, String remark) {
        this.code = code;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return LanguageHolder.getName(this.getClass(), this.getCode());
    }

    public String getRemark() {
        return LanguageHolder.getName("MemberLevelRuleTypeEnum.r.".concat(String.valueOf(this.getCode())));
    }

    public static String getCodeMsg(Integer code) {
        return LanguageHolder.getName(MemberLevelRuleTypeEnum.class, code);
    }

    public static String getRemark(Integer code) {
        return LanguageHolder.getName("MemberLevelRuleTypeEnum.r.".concat(String.valueOf(code)));
    }
}
